<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="A.png">
    <title>喜气洋洋小四班·班刊展示</title>
    <link rel="stylesheet" type="text/css" href="html_assets/antd.min.css">
    <link rel="stylesheet" type="text/css" href="html_assets/index.css">
    <link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
</head>
<body>
    <div id="app">
        <!--头-->
        <nav>
           <ul id="nav-ul">
                <li id="nav-icon">
                    <a onclick="loadDoc('#')">
                        <strong style="font-size: 25px">国庆班刊</strong>
                    </a>
                    
                </li>
                <li id="nav-search">
                    <form>
                        <input type="text" id="nav-inpt" placeholder="请输入">
                        <button type="submit"></button>
                    </form>
                </li>
                <li id="nav-changeBG">
                    <a href='https://gitee.com/CQYS-202404/10.1'><img src='https://gitee.com/CQYS-202404/10.1/widgets/widget_6.svg' alt='Fork me on Gitee'></img></a>
                </li>
           </ul>
        </nav>
    
        <main>          
            <container>
                <div id="main-left" style="width: 25%;">
                    <div id="main-left-box">
                        <!-- 同级目录 -->
                        <ul id="main-index"></ul>
                    </div>                   
                </div>
            </container> 
            <div id="main-center" style="width: 65%">
                <div id="doc-content"></div>
                <footer></footer>
            </div>  
        </main>
        
    </div>
</body>
<script>
    $(document).ready(function(){ 
        //分类名
        let sort = [
            "班刊信息",
            "学习分享",
            "一等奖",
            "二等奖",
            "三等奖",
            "贡献者名单"
        ]
        //目录数据
        let tag = [
            {//sort所属分类序号order排列序号
            //
                name:"班刊首页",
                sort:0,
                order:1,
                url:"#manual/1_start.md"
            },   
            {//sort所属分类序号order排列序号
            //
                name:"欢度国庆·情满中国",
                sort:0,
                order:1,
                url:"#manual/欢度国庆.md"
            },          
            {
                name:"热点新闻",
                sort:1,
                order:1,
                url:"#manual/新闻.md"
            },
            {
                name:"名著推荐",
                sort:1,
                order:1,
                url:"#manual/名著推荐.md"
            },
            {
                name:"电影推荐",
                sort:1,
                order:1,
                url:"#manual/电影推荐.md"
            },
            //获奖作文
            {
            name:"小街温情-赵梓含",
                sort:2,
                order:1,
                url:"#manual/赵梓含·小街温情.md"
            },
            {
            name:"我的一天-赵梓含",
                sort:3,
                order:1,
                url:"#manual/赵梓含·我的一天.md"
            },            
            {
            name:"花中最美是朴实-罗鑫睿",
                sort:3,
                order:1,
                url:"#manual/罗鑫睿·花中最美是朴实.md"
            },     
            {
            name:"不老的老街-翟一航",
                sort:3,
                order:1,
                url:"#manual/翟一航·不老的老街.md"
            },       
            {
            name:"晒晒我们班的牛人-何思源",
                sort:3,
                order:1,
                url:"#manual/何思源·晒晒我们班的牛人.md"
            },      
            {
            name:"永远热烈的街道-荀译萱",
                sort:3,
                order:1,
                url:"#manual/荀译萱·永远热烈的街道.md"
            },                
            {
            name:"我的一天-唐菡梓",
                sort:4,
                order:1,
                url:"#manual/唐菡梓·我的一天.md"
            },   
            {
            name:"晒晒我们班的牛人-陈璿如",
                sort:4,
                order:1,
                url:"#manual/陈璿如·晒晒我们班的牛人.md"
            },  
            {
            name:"晒晒我们班的牛人-蒋浩铭",
                sort:4,
                order:1,
                url:"#manual/蒋浩铭·晒晒我们班的牛人.md"
            },   
            {
            name:"晒晒我们班的牛人-赵梓含",
                sort:4,
                order:1,
                url:"#manual/赵梓含·晒晒我们班的牛人.md"
            },       
            {
            name:"漫天灿烂夜空星，饱蘸香韵茶中菊-戴君帆",
                sort:4,
                order:1,
                url:"#manual/戴君帆·漫天灿烂夜空星，饱蘸香韵茶中菊.md"
            }, 
            {
            name:"清水粽子-刘庆洋睿",
                sort:4,
                order:1,
                url:"#manual/刘庆洋睿·清水粽子.md"
            },  
            {
            name:"原来苔藓也是一种风景-覃朗",
                sort:4,
                order:1,
                url:"#manual/覃朗·原来苔藓也是一种风景.md"
            },    
            {
            name:"生来顽强-周承熠",
                sort:4,
                order:1,
                url:"#manual/周承熠·生来顽强.md"
            },     
            {
            name:"致贡献者",
                sort:5,
                order:1,
                url:"#manual/贡献名单.md"
            },  
        ]
        for(let i in sort){
            $('<li id="main-sort'+i+'">'+sort[i]+'</li>').appendTo($('#main-index'))
        }
        for(let k in tag){ 
            let addNode = '<a name="a'+tag[k].sort+'-'+tag[k].order+'" href='+tag[k].url+'>'+tag[k].name+'</a>'
            let sortNode = '#main-sort'+tag[k].sort
            if(!($(sortNode).children('a').length)){
                //第一个插进来的
                $(addNode).appendTo($(sortNode))
            }
            else{
                //不是第一个插进来的
                let lastChildNode = $(sortNode).children(':last-child')
                let lastChildOrder = parseInt(getNumber(lastChildNode,'a'+tag[k].sort+'-'))
                rank(tag[k],lastChildOrder,lastChildNode)
            }
        
        }
        function rank(data,lastorder,lastnode){
            let addNode = '<a name="a'+data.sort+'-'+data.order+'" href='+data.url+'>'+data.name+'</a>'
            let sortNode = '#main-sort'+data.sort
            if(data.order==0){
                $(sortNode).children(':first-child').before(addNode)
            }else{
                while(data.order<lastorder){
                    lastnode = lastnode.prev()
                    lastorder = parseInt(getNumber(lastnode,'a'+data.sort+'-'))             
                }
                lastnode.after(addNode)
            }    
        }
        function getNumber(node,str){
            return node.attr('name').split(str)[1]
        }
     })
     
       
     
</script>
<script src="html_assets/moment-with-locales.js"></script>
<script src="html_assets/vue.min.js"></script>
<script src="html_assets/antd-with-locales.min.js"></script>
<script src="html_assets/zepto.min.js"></script>
<script src="html_assets/commonmark.js"></script>
<script src="html_assets/documents.js"></script>
<script src="html_assets/index.js"></script>
<strong>网站作者：陈卓、唐奈尘</strong>
</html>